<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="css/cs.css">
</head>

<body>
    <div id="b_box">
        <ul id="box">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
        <button id="but" onclick="box.className='a'+fn()">刷新</button>
    </div>
</body>
<script>
    function fn() {
        var r = parseInt((Math.random()) * 10);
        if (r >= 1 && r < 7) {
            return r;
        } else {
            return fn();
        }
    }
    fn();

</script>

</html>
